<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="dist/vue.js"></script>
  <style>
    .box {
      width: 100px;
      height: 100px;
      background-color: #f66;
    }
  </style>
</head>
<body>
  <div id="app">
    <input type="text" v-model="username" v-on:keyup.alt.67="clear"> {{ username }}
    <!-- Ctrl + Click -->
    <input type="text" v-model="username" v-on:keyup.17="clear">{{ username }}
    <div v-on:click.ctrl="doSomething">Do something</div>

    <!-- 即使 Alt 或 Shift 被一同按下时也会触发 -->
    <button v-on:click.ctrl="doSomething1">Alt/Shift + ctrl</button>

    <!-- 有且只有 Ctrl 被按下的时候才触发 -->
    <button v-on:click.ctrl.exact="doSomething2">只有Ctrl键</button>

    <!-- 没有任何系统修饰符被按下的时候才触发 -->
    <button v-on:click.exact="doSomething3">没有任何系统修饰符</button>
</div>
</body>
<script>
  // v-if 与 v-show的区别
  const vm = new Vue({
    el: '#app',
    data: {
      username: ''
    },
    methods: {
      clear () {
        this.username = ''
      },
      doSomething() {
          this.username = 'lmx'
      },
      doSomething1() {
          this.username = 'cyj'
      },
      doSomething2() {
          this.username = 'gmq'
      }, 
      doSomething3() {
          this.username = 'xxm'
      }
    }
  })

</script>
</html>